import QtQuick 2.12
import QtQuick.Controls 2.5
import QtQuick.Window 2.12
import QtQuick.Layouts 1.0

Window {
    id: root
    visible: true
    width: 400
    height: 300
    color: "Grey"
    title: "QML Window"
    Rectangle{
        y: 68
        color: "blue"
        anchors.left: parent.left
        anchors.leftMargin: 130
        anchors.right: parent.right
        anchors.rightMargin: 170
        anchors.bottom: parent.bottom
        anchors.bottomMargin: 132
        height: 100
    }

    Label {
        id: label
        x: 109
        y: 245
        width: 170
        height: 15
        text: qsTr("This is a QML Window")
        anchors.bottom: parent.bottom
        anchors.bottomMargin: 40
    }

    RowLayout {
        id: row2
        height: 40
        Layout.fillHeight: true
        Layout.fillWidth: true
        width: root.width

        Button {
            id: buttonClose
            text: "Close only"
            Layout.fillWidth: true
            onClicked:{
                console.log(" MyRectangle.buttonClose.onClicked()")
                root.close()
            }
        }

        Button {
            id: buttonDestroy
            text: "destroy"
            Layout.fillWidth: true
            onClicked:{
                console.log(" MyRectangle.buttonDestroy.onClicked()")
                root.destroy()
            }
        }


    }


}

/*##^##
Designer {
    D{i:1;anchors_width:100;anchors_x:130}
}
##^##*/
